package com.ghck.server.utils;

import com.google.gson.Gson;
import com.google.gson.JsonObject;

public class JSON {
	private static final Gson gson = new Gson();
	
	public static String toJSONString(Object o){
		return gson.toJson(o);
	}
	
	public static <T> T parse(String jsonStr, Class<T> classOfT){
		return gson.fromJson(jsonStr, classOfT);
	}

	public static JsonObject fromString(String jsonStr){
		return gson.fromJson(jsonStr,JsonObject.class);
	}
}
